import java.io.File;

public class DirectoriesTraversal {
	static void traverseFileSystem(File file, String indent) {
		System.out.println(indent + file.getName());
		if (file.isDirectory()) {
			File[] items = file.listFiles();
			for (File f : items) {
				traverseFileSystem(f, indent + "  ");
			}
		}
	}

	public static void main(String[] args) {
		traverseFileSystem(new File("c:/windows"), "");
	}
}
